//
//  AppDelegate+configure.m
//  Lovetome
//
//  Created by Xiemaoxiong on 16/7/6.
//  Copyright © 2016年 上海爱途蜜网络科技有限公司. All rights reserved.
//

#import "AppDelegate+configure.h"
#import "XMXTabBarViewController.h"
@implementation AppDelegate (configure)



-(void)cache {
    //设置缓冲区大小
    int cacheSizeMemory = 4*1024*1024; // 4MB
    int cacheSizeDisk = 100*1024*1024; // 100MB
    NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:cacheSizeMemory diskCapacity:cacheSizeDisk diskPath:@"nsurlcache"];
    [NSURLCache setSharedURLCache:sharedCache];
}


-(void)initLogger {
    [DDLog addLogger:[DDTTYLogger sharedInstance]];
    [[DDTTYLogger sharedInstance] setColorsEnabled:YES];;
    
    [[DDTTYLogger sharedInstance] setForegroundColor:[UIColor yellowColor] backgroundColor:nil forFlag:DDLogFlagDebug];
    [[DDTTYLogger sharedInstance] setForegroundColor:[UIColor grayColor] backgroundColor:nil forFlag:DDLogFlagInfo];
}


-(void)rootViewController {
    self.window = [[UIWindow alloc]initWithFrame:[[UIScreen mainScreen]bounds]];
    [self.window makeKeyAndVisible];
    
    NSArray *controllerArray = @[@"HomePageViewController",@"TakeMarriageViewController",@"StrategyViewController",@"LoginViewController"];
    NSArray * titleArray = @[@"首页",@"婚拍",@"攻略",@"我的"];
    NSArray *imageArray= @[@"home_tabbar",@"msg_tabbar",@"friend_tabbar",@"me_tabbar"];
    NSArray *selImageArray = @[@"home_tabbar_sel",@"msg_tabbar_sel",@"friend_tabbar_sel",@"me_tabbar_sel"];
    CGFloat tabBarHeight = 49.0;
    
    XMXTabBarViewController *rootViewController = [[XMXTabBarViewController alloc] initWithControllerArray:controllerArray titleArray:titleArray imageArray:imageArray selImageArray:selImageArray height:tabBarHeight];;
    self.window.rootViewController = rootViewController;
}


@end
